//
//  ViewController.m
//  test
//
//  Created by admin on 2018/8/3.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "ViewController.h"
#import "CViewController.h"
#import "BViewController.h"
#import "AViewController.h"
@interface ViewController ()
@property (nonatomic,strong) CViewController *cvc;
@property (nonatomic,strong) BViewController *bvc;
@property (nonatomic,strong) AViewController *avc;
@end

@implementation ViewController
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    AViewController *avc = [[AViewController alloc]init];
    self.avc = avc;
    BViewController *bvc = [[BViewController alloc]init];
    self.bvc = bvc;
    CViewController *cvc = [[CViewController alloc]init];
    self.cvc = cvc;
    
    
    [self addChildViewController:avc];
    [self addChildViewController:bvc];
    [self addChildViewController:cvc];
    
    
   
   
    
    
    
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)btn1:(id)sender {
    [self.view addSubview:self.avc.view];
    self.avc.view.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-100);
}
- (IBAction)btn2:(id)sender {
     [self.view addSubview:self.bvc.view];
     self.bvc.view.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-100);
}
- (IBAction)btn3:(id)sender {
     [self.view addSubview:self.cvc.view];
    self.cvc.view.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-100);
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
